Developer --> Technical Publications
PATHHardware Documentation > USB Devices > Mac OS USB DDK API Reference


USB Data Structures

These are the data structures defined by the USL for USB device descriptors. The current definitions can also be found in the USB.h file.

Driver Plug-in Dispatch Table Structure

The driver dispatch table used to match and initialize the appropriate driver with a device is of the form shown here. This structure is filled in by the class driver.

struct USBClassDriverPluginDispatchTable {
    UInt32                          pluginVersion;
                                   /* Version number of this */
                                   /* plugin for the dispatch table */
    USBDValidateHWProcPtr             validateHWProc;
                                   /* Pointer to */
                                   /* the procedure the driver */
                                   /* uses to verify that device is */
                                   /* the proper hardware */
    USBDInitializeDeviceProcPtr       initializeDeviceProc;
                                   /* Pointer to */
                                   /* the procedure that initializes */
                                   /* the class driver */
    USBDInitializeInterfaceProcPtr    initializeInterfaceProc;
                                   /* Pointer to procedure that */
                                   /* initializes a particular */
                                   /* interface in the class driver.*/
     USBDFinalizeProcPtr            finalizeProc;
                                   * Pointer to the procedure that */
                                   /* finalizes the class driver */
    USBDDriverNotifyProcPtr         notificationProc;
                                   /* Pointer to the procedure that */
                                   /* passes notifications to */
                                   /* the driver */

Device Descriptor Structure

The USB device descriptor is of this form:

struct USBDeviceDescriptor {
    UInt8   length;
    UInt8   descType;
    UInt16  usbRel;
    UInt8   deviceClass;
    UInt8   deviceSubClass;
    UInt8   protocol;
    UInt8   maxPacketSize;
    UInt16  vendor;
    UInt16  product;
    UInt16  devRel;
    UInt8   manuIdx;
    UInt8   prodIdx;
    UInt8   serialIdx;
    UInt8   numConf;
    UInt16  descEnd;
};

Configuration Descriptor Structure

The USB device configuration descriptor is of this form:

struct USBConfigurationDescriptor {
    UInt8   length;
    UInt8   descriptorType;
    UInt16  totalLength;
    UInt8   numInterfaces;
    UInt8   configValue;
    UInt8   configStrIndex;
    UInt8   attributes;
    UInt8   maxPower;
};

Interface Descriptor Structure

The USB device interface descriptor is of this form:

struct USBInterfaceDescriptor {
    UInt8   length;
    UInt8   descriptorType;
    UInt8   interfaceNumber;
    UInt8   alternateSetting;
    UInt8   numEndpoints;
    UInt8   interfaceClass;
    UInt8   interfaceSubClass;
    UInt8   interfaceProtocol;
    UInt8   interfaceStrIndex;
};

Endpoint Descriptor Structure

The USB device endpoint descriptor is of this form:

struct USBEndPointDescriptor {
    UInt8   length;
    UInt8   descriptorType;
    UInt8   endpointAddress;
    UInt8   attributes;
    UInt16  maxPacketSize;
    UInt8   interval;
};

HID Descriptor Structure

The USB HID descriptor is of this form:

struct USBHIDDescriptor {
    UInt8   descLen;
    UInt8   descType;
    UInt16  descVersNum;
    UInt8   hidCountryCode;
    UInt8   hidNumDescriptors;
    UInt8   hidDescriptorType;
    UInt8   hidDescriptorLengthLo;
    UInt8   hidDescriptorLengthHi;
};

HID Report Descriptor Structure

The USB HID report descriptor is of this form:

struct USBHIDReportDesc {
    UInt8   hidDescriptorType;
    UInt8   hidDescriptorLengthLo;
    UInt8   hidDescriptorLengthHi;
};

Hub Port Status Structure

The hub port status structure is of this form:

struct USBHubPortStatus {
    UInt16   portFlags;         /* Port status flags */
    UInt16   portChangeFlags;   /* Port changed flags */
};

© 1998 Apple Computer, Inc. – (Last Updated 23 Nov 98)

Previous | Back Up One Level | Next |